package com.atlin.project.service.inner;

import com.atlin.beaconsapicommon.model.domain.SysUser;
import com.atlin.beaconsapicommon.service.InnerSysUserService;
import com.atlin.project.service.SysUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

/**
 * @author atlin
 * @description 内部服务 - 用户管理
 * @createDate 2024/12/22 14:17
 */
@DubboService
public class InnerSysUserServiceImpl implements InnerSysUserService {

    @Resource
    private SysUserService sysUserService;


    @Override
    public SysUser getSysUserByAccessKey(String accessKey) {
        if (StringUtils.isBlank(accessKey)) return null;
        QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
        wrapper.eq("accessKey", accessKey);
        
        return sysUserService.getOne(wrapper);
    }
}
